﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tester.DL645.Instructions
{
    /// <summary>
    /// 
    /// </summary>
    public class GeneralInstruction:AbstractInstruction
    {

        public byte[] Data { get; set; }    
        /// <summary>
        /// 
        /// </summary>
        /// <param name="address"></param>
        public GeneralInstruction(string address, byte controlCode, byte[] data)
             : base(address, controlCode)
        {
            this.Data = data;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="buffer"></param>
        protected override void ApplyData(List<byte> buffer)
        {
            buffer.Add((byte)this.Data.Length);

            buffer.AddRange(this.Data);
        }
    }
}
